package com.yangwei.examination.teacher.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yangwei.examination.user.pojo.Teacher;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Exam {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String examName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;

    private String handleClassId;
    private String paperId;
    private Long teacherId;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @TableField(value = "view_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime viewTime;

    @TableField(exist = false)
    private HandleClass handleClass;
    @TableField(exist = false)
    private Paper paper;
    @TableField(exist = false)
    private Teacher teacher;
    @TableField(exist = false)
    private Boolean answerStatus = false;  //判断是否已答卷  用于examListStu
    @TableField(exist = false)
    private Boolean correctStatus =false;         //判断是否已批卷  用于examListFroStatistics
    @TableField(exist = false)
    private Integer submitCount; //统计本场测试已交卷的人数
    @TableField(exist = false)
    private CorrectAnswerPaper correctAnswerPaper; //用于获取改卷信息 submitTime
}
